Skip to main content

All Questions

1vote
2answers
3kviews

Add Properties from one array of Objects to another array of Objects based on property id

I do have my code running but again I'm wondering if there is a nicer solution since mine seems to be clumsy and I'm wondering if there is a better way like chaining (but I can't work out how to do ...
BreadcrumbPie's user avatar
11votes
4answers
3kviews

Restructuring JSON to create a new JSON where properties are grouped according to similar values

I have a JSON structure in the following example format: ...
fruitlessartery's user avatar
6votes
1answer
357views

JavaScript: A drawing program in OOP

I made a little drawing program in OOP. The game consists of a canvas which is basically a 2d array where the user can draw various shapes on it. There can be multiple shapes overlapped on top of each ...
Joji's user avatar
  • 325
4votes
2answers
301views

Maxcounters in JavaScript

I am trying to solve this question: MaxCounters. Solving it is straightforward, but solving it fast enough is proving very difficult. How can I improve the performance of this code? At the moment it ...
jackdaw's user avatar
2votes
2answers
156views

Divide the last element in an array of arrays among the remaining elements

The function below is part of an overall chunk of code to partition an array of size M into sub-arrays of size N. The function in question is written to handle the case: what if M isn't divisible by ...
Paul Gowder's user avatar
1vote
1answer
53views

converting object of arrays to an array of objects in a desired format

...
Vignesh Sharma's user avatar
2votes
2answers
1kviews

Iterating through two objects with different structures in parallel

I have two objects, one input = Array<Type> and one stored = Array<{..., Type}> What's the best (cleanest) way to ...
bxk21's user avatar
1vote
4answers
723views

Find value that occurs in odd number of elements

I am trying to solve the following exercise using Javascript: A non-empty array A consisting of N integers is given. The array contains an odd number of elements, and each element of the array can be ...
Anirban Bera's user avatar
7votes
5answers
4kviews

Find number repeated odd times in array

I completed the following exercise: You are given an array of repeating numbers. All numbers repeat in an even way, except for one. Find that odd occurring number. ...
user7496931's user avatar
2votes
4answers
158views

Formatting a list with commas and occasional line breaks

I have an array mapped to make a typical result string separated by commas and with numbers a bit beautified with array.map(formatNumber). Expected format is <...
joc's user avatar
  • 235

close